import service from "@/service/service";

import service3 from "@/service/service3";
import service4 from "@/service/service4";
import service1 from "@/service/service1";
import service10 from "@/service/service10";
import service5 from "@/service/service5";
import service2 from "@/service/service2";


//管理员登录
export function login(adminInfo) {
    return service3({
        method: 'post',
        url: '/net/login',
        data: adminInfo
    })
}

//商品列表
export function vegetableList(vegetableSort) {
    return service({
        method: 'get',
        url: '/vegetable/sort/'+vegetableSort,
    })
}

//获取登录管理员信息
export function getNetInfo(){
    return service2({
        method: "get",
        url: '/net/login/info',
    })
}

//登录时获取简单社区信息
export function getSimpleCommunity(){
    return service5({
        method: "get",
        url: '/community/login'
    })
}

//添加管理员
export function addAdmin(adminList){
    return service2({
        method: 'post',
        url: '/net/add',
        data:adminList
    })
}

//获取网格员列表
export function getNetList(){
    return service2({
        method: 'get',
        url: '/net/get/netList'
    })
}

//根据姓名获取网格员信息
export function getNetByName(name){
    return service2({
        method: 'get',
        url: '/net/get/'+name
    })
}

//查询网格员姓名
export function getNetName(){
    return service2({
        method: 'get',
        url: '/net/get/name'
    })
}

//修改网格员信息
export function updateNet(info){
    return service2({
        method:'post',
        url:'/net/update',
        data: info

    })
}

//添加商品
export function addProduct(product){
    return service({
        method: 'post',
        url: '/vegetable/add/vegetable',
        data:product
    })
}

// 删除管理员
export function deleteAdmin(username){
    return service({
        method:'get',
        url: '/deleteAdmin/'+username,
    })
}

// 请求用户列表
export function userList(){
    return service1({
        method: 'get',
        url: '/user/selectAll'
    })
}

//禁用对应用户
export function delUser(isDeleted,userId){
    return service1({
        method: 'get',
        url: '/user/isDeleted/'+isDeleted+'/'+userId
    })
}



// 所有核酸结果查询
export function selectAllResult(){
    return service5({
        method:'get',
        url: '/ydt/ydt-nucleic_acid_test_appointment/select/all',

    })
}


// 查询所有任务
export function workList(page) {
    return service4({
        method: 'get',
        url: '/work/list-by-work/' + page,
        data: page
    })
}

//查询未完成任务
export function NotFinishWorkList(page) {
    return service4({
        method: 'get',
        url: 'work/list-not-work/' + page,
        data: page
    })
}

//分配任务
export function GiveWork(workId,volunteerId) {
    return service4({
        method: 'get',
        url: 'work/give/'+ workId+'/'+volunteerId,
    })
}

//查用户信息
export function WorkUser(userId) {
    return service1({
        method: 'get',
        url: '/user/query/' + userId,
        data: userId
    })
}

//查志愿者信息
export function VolunteerList() {
    return service1({
        method: 'get',
        url: '/user/getVolunteer',
    })
}

//外出已审核列表
export function outList(){
    return service5({
        method: 'get',
        url:'/out/is/check'
    })
}

//外出未审核列表
export function notCheck(){
    return service5({
        method: 'get',
        url:'/out/outRequest'
    })
}

//通过审核
export function checkTrue(outId){
    return service5({
        method: 'get',
        url: '/out/check/true/'+outId
    })
}

//驳回审核
export function checkFalse(outId){
    return service5({
        method: 'get',
        url: '/out/check/false/'+outId
    })
}

//发布通知
export function addNotice(notice){
    return service5({
        method: 'post',
        url: '/community/notice/add',
        data: notice
    })
}

//查询通知列表
export function getNoticeList(){
    return service5({
        method: 'get',
        url: '/community/notice/list1'
    })
}

//删除对应通知
export function delNoticeByNoticeId(noticeId){
    return service5({
        method: 'get',
        url: '/community/notice/delete/'+noticeId
    })
}

//查询用户打卡信息
export function getSignInfo(difference,page,pageSize){
    return service5({
        method: 'get',
        url: '/community/location/list-sign-in-info',
        data: difference ,page,pageSize
    })
}


//查正在审核的志愿者信息
export function VolunteerApply() {
    return service1({
        method: 'get',
        url: '/user/getApplyVolunteer',
    })
}

//得到所有的订单详细信息
export function getOrderDetail(){
    return service({
        method:'get',
        url:'/vegetable/get/detail/order'
    })
}

//创建二维码
export function QrCreate() {
    return service10({
        method: 'post',
        url: '/code/createQr',
    })
}

//查询二维码信息
export function QrInfo() {
    return service10({
        method: 'get',
        url: '/code/getByCommunityId',
    })
}

export function VolunteerApplySuccess(userId){
    return service1({
        method:'post',
        url:'/user/isVolunteerSet'+userId,
        data:userId
    })
}

export function VolunteerApplyFail(userId){
    return service1({
        method:'post',
        url:'/user/isVolunteerFail'+userId,
        data:userId
    })
}